<template>
  <div id="dplayer" class="d-player"></div>
</template>

<script>
import DPlayer from 'dplayer';
export default {
  name: 'HelloWorld',
  props: {
    msg: String
  },
  mounted() {
    this.create()
  },
  methods:{
    create(){
      new DPlayer({
        container: document.getElementById('dplayer'),
        autoplay: true,
        lang: 'zh-cn', // 语言
        preventClickToggle: true,
        screenshot: true,
        video: {
          url: 'https://cyw5000.kodview.com/bb.mp4',
          pic: '',
          thumbnails: '',
          // quality: [
          //   { name:'HD', url:'https://cyw5000.kodview.com/bb.mp4', type:'hls' },
          //   { name:'SD', url:'https://cyw5000.kodview.com/bb.mp4', type:'normal' },
          // ],
        },
      });
    }
  }
}
</script>

<style scoped lang="less">
  .d-player {
    width: 100%;
    height: 250px
  }
</style>
